error: expected `;' before iter ?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rameshjumgam
    New Member
    • Dec 2010
    • 10

    #1

    error: expected `;' before iter ?

    i am having in my code like

    Code:
    std::list<T*>::const_iterator iter=lst.begin();
    and i am getting error


    Code:
     error: expected `;' before âiterâ
    /root/INCLUDE/cw/gdlist.h:140: error: âiterâ was not declared in this scope
    /root/INCLUDE/cw/gdlist.h:142: error: âiterâ was not declared in this scope
    /root/INCLUDE/cw/gdlist.h: In member function âT*& CWGDList<T>::at(size_t)â:
    /root/INCLUDE/cw/gdlist.h:176: error: expected `;' before âiterâ
    /root/INCLUDE/cw/gdlist.h:178: error: âiterâ was not declared in this scope
    /root/INCLUDE/cw/gdlist.h:180: error: âiterâ was not declared in this scope
    /root/INCLUDE/cw/gdlist.h: In member function âconst T* CWGDList<T>::at(size_t) constâ:
    /root/INCLUDE/cw/gdlist.h:208: error: expected `;' before âiterâ
    /root/INCLUDE/cw/gdlist.h:210: error: âiterâ was not declared in this scope
    /root/INCLUDE/cw/gdlist.h:212: error: âiterâ was not declared in this scope
    /root/INCLUDE/cw/gdlist.h: In member function âvoid CWGDList<T>::clearAndDestroy()â:
    /root/INCLUDE/cw/gdlist.h:234: error: expected `;' before âiâ
    /root/INCLUDE/cw/gdlist.h:236: error: âiâ was not declared in this scope
    /root/INCLUDE/cw/gdlist.h: In member function âT* CWGDList<T>::find(CWBoolean (*)(const T*, const void*), const void*) constâ:
    /root/INCLUDE/cw/gdlist.h:270: error: expected `;' before âiterâ
    /root/INCLUDE/cw/gdlist.h:272: error: âiterâ was not declared in this scope
    /root/INCLUDE/cw/gdlist.h: In member function âvoid CWGDList<T>::insertAt(size_t, T*)â:
    /root/INCLUDE/cw/gdlist.h:372: error: expected `;' before âiterâ
    /root/INCLUDE/cw/gdlist.h:374: error: âiterâ was not declared in this scope
    /root/INCLUDE/cw/gdlist.h:376: error: âiterâ was not declared in this scope
    /root/INCLUDE/cw/gdlist.h: In member function âT* CWGDList<T>::remove(CWBoolean (*)(const T*, const void*), const void*)â:
    /root/INCLUDE/cw/gdlist.h:460: error: expected `;' before âiterâ
    /root/INCLUDE/cw/gdlist.h:462: error: âiterâ was not declared in this scope
    /root/INCLUDE/cw/gdlist.h: In member function âT* CWGDList<T>::removeReference(const T*)â:
    /root/INCLUDE/cw/gdlist.h:504: error: expected `;' before âiterâ
    /root/INCLUDE/cw/gdlist.h:506: error: âiterâ was not declared in this scope
    /root/INCLUDE/cw/gdlist.h: At global scope:
    /root/INCLUDE/cw/gdlist.h:570: error: type âstd::list<T*, std::allocator<T*> >â is not derived from type âCWGDListIterator<T>â
    /root/INCLUDE/cw/gdlist.h:570: error: expected â;â before âiterâ
    /root/INCLUDE/cw/gdlist.h: In constructor âCWGDListIterator<T>::CWGDListIterator(CWGDList<T>&)â:
    /root/INCLUDE/cw/gdlist.h:588: error: class âCWGDListIterator<T>â does not have any field named âiterâ
    /root/INCLUDE/cw/gdlist.h: In member function âCWBoolean CWGDListIterator<T>::atFirst() constâ:
    /root/INCLUDE/cw/gdlist.h:608: error: âiterâ was not declared in this scope
    /root/INCLUDE/cw/gdlist.h: In member function âCWBoolean CWGDListIterator<T>::atLast() constâ:
    /root/INCLUDE/cw/gdlist.h:624: error: âiterâ was not declared in this scope
    /root/INCLUDE/cw/gdlist.h: In member function âT* CWGDListIterator<T>::findNextReference(const T*)â:
    /root/INCLUDE/cw/gdlist.h:642: error: âiterâ was not declared in this scope
    /root/INCLUDE/cw/gdlist.h:648: error: âiterâ was not declared in this scope
    /root/INCLUDE/cw/gdlist.h:652: error: âiterâ was not declared in this scope
    /root/INCLUDE/cw/gdlist.h:658: error: âiterâ was not declared in this scope
    /root/INCLUDE/cw/gdlist.h: In member function âT* CWGDListIterator<T>::key() constâ:
    /root/INCLUDE/cw/gdlist.h:694: error: âiterâ was not declared in this scope
    /root/INCLUDE/cw/gdlist.h: In member function âT* CWGDListIterator<T>::operator()()â:
    /root/INCLUDE/cw/gdlist.h:712: error: âiterâ was not declared in this scope
    /root/INCLUDE/cw/gdlist.h:716: error: âiterâ was not declared in this scope
    /root/INCLUDE/cw/gdlist.h:724: error: âiterâ was not declared in this scope
    /root/INCLUDE/cw/gdlist.h:730: error: âiterâ was not declared in this scope
    /root/INCLUDE/cw/gdlist.h: In member function âvoid CWGDListIterator<T>::operator++()â:
    /root/INCLUDE/cw/gdlist.h:758: error: âiterâ was not declared in this scope
    /root/INCLUDE/cw/gdlist.h:770: error: âiterâ was not declared in this scope
    /root/INCLUDE/cw/gdlist.h: In member function âvoid CWGDListIterator<T>::operator--()â:
    /root/INCLUDE/cw/gdlist.h:786: error: âiterâ was not declared in this scope
    /root/INCLUDE/cw/gdlist.h: In member function âvoid CWGDListIterator<T>::operator+=(size_t)â:
    /root/INCLUDE/cw/gdlist.h:806: error: âiterâ was not declared in this scope
    /root/INCLUDE/cw/gdlist.h:822: error: âiterâ was not declared in this scope
    /root/INCLUDE/cw/gdlist.h: In member function âvoid CWGDListIterator<T>::operator-=(size_t)â:
    /root/INCLUDE/cw/gdlist.h:846: error: âiterâ was not declared in this scope
    /root/INCLUDE/cw/gdlist.h: In member function âT* CWGDListIterator<T>::remove()â:
    /root/INCLUDE/cw/gdlist.h:874: error: âiterâ was not declared in this scope
    /root/INCLUDE/cw/gdlist.h:876: error: âiterâ was not declared in this scope
    /root/INCLUDE/cw/gdlist.h:880: error: âiterâ was not declared in this scope
    /root/INCLUDE/cw/gdlist.h: In member function âvoid CWGDListIterator<T>::reset()â:
    /root/INCLUDE/cw/gdlist.h:906: error: âiterâ was not declared in this scope
    /root/INCLUDE/cw/gdlist.h: In member function âvoid CWGDListIterator<T>::toFirst()â:
    /root/INCLUDE/cw/gdlist.h:924: error: âiterâ was not declared in this scope
    /root/INCLUDE/cw/gdlist.h: In member function âvoid CWGDListIterator<T>::toLast()â:
    /root/INCLUDE/cw/gdlist.h:942: error: âiterâ was not declared in this scope
    can any body help me plz, thanks in advance
    Last edited by Niheel; Dec 15 '10, 08:47 AM.
  • rstiltskin
    New Member
    • Feb 2010
    • 14

    #2
    It looks like you forgot to
    #include <list>

    Comment

    Working...